import java.util.Random;
import java.util.Scanner;


public class Sort {
	
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		System.out.print("Bitte geben Sie die länge des Feldes an: ");
		int fieldLenght = scanner.nextInt();

		double[] field = new double[fieldLenght];
		Random ran = new Random(0);
		
		for (int i = 0; i < field.length; i++)
		{
			field[i] = ran.nextDouble();
			System.out.println(field[i]);
		}
		
		for (int i = 0; i < field.length; i++) 
		{
			for (int j = 0; j < field.length - i - 1; j++)
			{
				if (field[j] > field[j + 1])
				{
					field[j] = field[j] + field[j + 1];
					field[j + 1] = field[j] - field[j + 1];
					field[j] = field[j] - field[j + 1];
				}
			}
		}
		
		for (int i = 0; i < field.length; i++)
			System.out.println(field[i]);
	}
}
